var $ = require('../../lib/jquery');
var util = require('./common/util');
var template = require('../tpl/template');
var nav = require('./common/nav');
var _header = require('./common/header');
var minHeight = require('./common/minHeight');
minHeight.init();
var _nav = new nav();
var header = new _header();
var jzb = { // 接种本
  fetch: function (medicalid) {
    var _this = this;
    util.fetch('api/inoculate/queryList').then(function (res){
      _this.render(res.data);
    }).fail(function (res){

    })
  },
  render: function (data) {
    var left_tpl = template('jzb_left',{data:data});
    var right_tpl = template('jzb_right',{data:data});
    $('.js_jzb_left').html(left_tpl);
    $('.js_jzb_right').html(right_tpl)
  },
  bindevent: function (medicalid) {
    $('.js_jzb_left').on('click', '.js_month',function () {
      $('.js_jzb_left').find('span').removeClass('color');
      $(this).find('.js_need_color').addClass('color');
    })
    $('.js_index').on('click', function() {
      location.href = "./index.html";
    })
    $('.js_yfjzfw').on('click',function(){
      history.back();
    })
  }
}
jzb.fetch();
jzb.bindevent();